package com.fsnbigdata.service.impl;
import com.fsnbigdata.service.api.AnimalConservationLocationService;
import org.springframework.roo.addon.layers.service.annotations.RooServiceImpl;
import com.fsnbigdata.domain.AnimalConservation;
import com.fsnbigdata.domain.AnimalConservationLocation;
import com.fsnbigdata.repository.AnimalConservationLocationRepository;
import io.springlets.data.domain.GlobalSearch;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * = AnimalConservationLocationServiceImpl
 *
 * TODO Auto-generated class documentation
 *
 */
@RooServiceImpl(service = AnimalConservationLocationService.class)
@Service
@Transactional(readOnly = true)
public class AnimalConservationLocationServiceImpl implements AnimalConservationLocationService {

    /**
     * TODO Auto-generated attribute documentation
     *
     */
    private AnimalConservationLocationRepository animalConservationLocationRepository;

    /**
     * TODO Auto-generated constructor documentation
     *
     * @param animalConservationLocationRepository
     */
    @Autowired
    public AnimalConservationLocationServiceImpl(AnimalConservationLocationRepository animalConservationLocationRepository) {
        setAnimalConservationLocationRepository(animalConservationLocationRepository);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return AnimalConservationLocationRepository
     */
    public AnimalConservationLocationRepository getAnimalConservationLocationRepository() {
        return animalConservationLocationRepository;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param animalConservationLocationRepository
     */
    public void setAnimalConservationLocationRepository(AnimalConservationLocationRepository animalConservationLocationRepository) {
        this.animalConservationLocationRepository = animalConservationLocationRepository;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param entity
     * @return AnimalConservationLocation
     */
    @Transactional
    public AnimalConservationLocation save(AnimalConservationLocation entity) {
        return getAnimalConservationLocationRepository().save(entity);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return AnimalConservationLocation
     */
    public AnimalConservationLocation findOne(Long id) {
        return getAnimalConservationLocationRepository().findOne(id);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return AnimalConservationLocation
     */
    public AnimalConservationLocation findOneForUpdate(Long id) {
        return getAnimalConservationLocationRepository().findOneDetached(id);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param ids
     * @return List
     */
    public List<AnimalConservationLocation> findAll(Iterable<Long> ids) {
        return getAnimalConservationLocationRepository().findAll(ids);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param animalConservation
     * @param globalSearch
     * @param pageable
     * @return Page
     */
    public Page<AnimalConservationLocation> findByAnimalConservation(AnimalConservation animalConservation, GlobalSearch globalSearch, Pageable pageable) {
        return getAnimalConservationLocationRepository().findByAnimalConservation(animalConservation, globalSearch, pageable);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @param animalConservation
     * @return Long
     */
    public long countByAnimalConservation(AnimalConservation animalConservation) {
        return getAnimalConservationLocationRepository().countByAnimalConservation(animalConservation);
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Class
     */
    public Class<AnimalConservationLocation> getEntityType() {
        return AnimalConservationLocation.class;
    }

    /**
     * TODO Auto-generated method documentation
     *
     * @return Class
     */
    public Class<Long> getIdType() {
        return Long.class;
    }
}
